{% extends 'blog/base.html' %}

{% block content %}
{% for post in posts %}
	<div class="post">
		<p>published: {{ post.published_date }}</p>
		<h1><a href="{% url 'blog.views.post_detail' pk=post.pk %}">{{ post.title }}</a></h1>
		<p>{{ post.text|linebreaks }}</p>
	</div>
{% endfor %}
{% if page %}
	<div class="pagination">
		<span class="setp-links">
			{% if posts.has_previous %}
				<a href="?page={{ posts.previous_page_number }}">previous</a>
			{% endif %}
			<span class="current">
				Page {{ posts.number }} of {{ posts.paginator.num_pages }}.
			</span>
			{% if posts.has_next %}
				<a href="?page={{ posts.next_page_number }}">next</a>
			{% endif %}
		</span>
	</div>
{% endif %}
{% endblock content %}